package com.example.untils;

import lombok.extern.slf4j.Slf4j;

import java.awt.*;
import java.net.InetAddress;
import java.net.UnknownHostException;

@Slf4j
public class RunHttp {
    public static String getIp(){
        String ip = "127.0.0.1";
        try {
            InetAddress localhost = InetAddress.getLocalHost();
            ip  = localhost.getHostAddress();
            System.out.println("本机IP地址：" + ip);
            log.info("本机IP地址：" + ip);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return ip;
    }
}
